package cn.stylefeng.guns.sys.modular.system.controller;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.sys.modular.system.entity.DsstoreBillDeliveryAudit;
import cn.stylefeng.guns.sys.modular.system.model.params.DsstoreBillDeliveryAuditParam;
import cn.stylefeng.guns.sys.modular.system.service.DsstoreBillDeliveryAuditService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * 控制器
 *
 * @author jiangge
 * @Date 2021-07-14 15:28:01
 */
@Controller
@RequestMapping("/dsstoreBillDeliveryAudit")
public class DsstoreBillDeliveryAuditController extends BaseController {

    private String PREFIX = "/modular/system/dsstoreBillDeliveryAudit";

    @Autowired
    private DsstoreBillDeliveryAuditService dsstoreBillDeliveryAuditService;

    /**
     * 跳转到主页面
     *
     * @author jiangge
     * @Date 2021-07-14
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "/dsstoreBillDeliveryAudit.html";
    }

    /**
     * 新增页面
     *
     * @author jiangge
     * @Date 2021-07-14
     */
    @RequestMapping("/add")
    public String add() {
        return PREFIX + "/dsstoreBillDeliveryAudit_add.html";
    }

    /**
     * 编辑页面
     *
     * @author jiangge
     * @Date 2021-07-14
     */
    @RequestMapping("/edit")
    public String edit() {
        return PREFIX + "/dsstoreBillDeliveryAudit_edit.html";
    }

    /**
     * 新增接口
     *
     * @author jiangge
     * @Date 2021-07-14
     */
    @RequestMapping("/addItem")
    @ResponseBody
    public ResponseData addItem(DsstoreBillDeliveryAuditParam dsstoreBillDeliveryAuditParam) {
        this.dsstoreBillDeliveryAuditService.add(dsstoreBillDeliveryAuditParam);
        return ResponseData.success();
    }

    /**
     * 编辑接口
     *
     * @author jiangge
     * @Date 2021-07-14
     */
    @RequestMapping("/editItem")
    @ResponseBody
    public ResponseData editItem(DsstoreBillDeliveryAuditParam dsstoreBillDeliveryAuditParam) {
        this.dsstoreBillDeliveryAuditService.update(dsstoreBillDeliveryAuditParam);
        return ResponseData.success();
    }

    /**
     * 删除接口
     *
     * @author jiangge
     * @Date 2021-07-14
     */
    @RequestMapping("/delete")
    @ResponseBody
    public ResponseData delete(DsstoreBillDeliveryAuditParam dsstoreBillDeliveryAuditParam) {
        this.dsstoreBillDeliveryAuditService.delete(dsstoreBillDeliveryAuditParam);
        return ResponseData.success();
    }

    /**
     * 查看详情接口
     *
     * @author jiangge
     * @Date 2021-07-14
     */
    @RequestMapping("/detail")
    @ResponseBody
    public ResponseData detail(DsstoreBillDeliveryAuditParam dsstoreBillDeliveryAuditParam) {
        DsstoreBillDeliveryAudit detail = this.dsstoreBillDeliveryAuditService.getById(dsstoreBillDeliveryAuditParam.getId());
        return ResponseData.success(detail);
    }

    /**
     * 查询列表
     *
     * @author jiangge
     * @Date 2021-07-14
     */
    @ResponseBody
    @RequestMapping("/list")
    public LayuiPageInfo list(DsstoreBillDeliveryAuditParam dsstoreBillDeliveryAuditParam) {
        return this.dsstoreBillDeliveryAuditService.findPageBySpec(dsstoreBillDeliveryAuditParam);
    }

}


